<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>修改</title>
    <script src="/static/jquery-1.11.3.js"></script>
</head>
<body>
账号<input type="text" name="username" id="username" value="">
密码<input type="password" name="password" id="password" value="">
年龄<input type="text" name="age" id="age" value="">
<button id="login">提交</button>
<script>
    $(function () {
        var id = window.location.href.split("?")[1].split("=")[1];
        var $usernameInput = $('#username');
        var $passwordInput = $('#password');
        var $ageInput = $('#age')
        var param = {id:id}
        console.log(param)
        $.get('/huixian', param, function (data) {
            console.log(data)
            $usernameInput.val(data.username)
            $passwordInput.val(data.password)
            $ageInput.val(data.age)
        })
    })
    $(function () {
        $('#login').click(function () {
            var id = window.location.href.split("?")[1].split("=")[1];
            console.log(id)
            var $usernameInput = $('#username');
            var $passwordInput = $('#password');
            var $ageInput = $('#age')
            var u = $usernameInput.val();
            var p = $passwordInput.val();
            var a = $ageInput.val()
            var param = { id:id,username: u, password: p,age:a};
            console.log(param);
            $.get('/xiugai', param, function () {

            })
        })
    })
</script>
</body>
</html>